home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / et / et3_0-a1.lha / et3 / src / CommandProcessor.h < prev    next >
C/C++ Source or Header  |  1992-04-27  |  2KB  |  81 lines

  1. #ifndef CommandProcessor_First
  2. #ifdef __GNUG__
  3. //pragma once
  4. #pragma interface
  5. #endif
  6. #define CommandProcessor_First
  7.  
  8. #include "Command.h"
  9.  
  10. //---- CommandProcessor --------------------------------------------------------
  11.  
  12. class CommandProcessor : public Object {
  13. protected:
  14.     int cap, changeCount;
  15.  
  16.     virtual void PerformNormalCommand(Command* cmd);
  17.     virtual Command *GetAt(int i);
  18.     virtual void FinishFrom(int n);
  19. public:
  20.     MetaDef(CommandProcessor);
  21.     CommandProcessor();
  22.     ~CommandProcessor();
  23.     bool Modified()
  24.     { return changeCount > 0; }
  25.     int Size()
  26.     { return cap; }
  27.     void PerformCommand(Command* cmd);
  28.     void DoCreateMenu(class Menu *menu);
  29.     void DoSetupMenu(Menu *menu);
  30.     void DoMenuCommand(int cmdId);
  31.     void Finish();
  32. };
  33.  
  34. //---- CommandProcessor --------------------------------------------------------
  35.  
  36. class CommandProcessor1 : public CommandProcessor {
  37. protected:
  38.     class Command *lastCmd;
  39.  
  40.     void PerformNormalCommand(Command* cmd);
  41.     void FinishFrom(int n);
  42.     Command *GetAt(int i);
  43. public:
  44.     MetaDef(CommandProcessor1);
  45.     CommandProcessor1();
  46. };
  47.  
  48. //---- CommandProcessorN -------------------------------------------------------
  49.  
  50. class CommandProcessorN : public CommandProcessor {
  51. protected:
  52.     class ObjArray *cmdHistory;
  53.  
  54.     ~CommandProcessorN();
  55.     Command *GetAt(int i);
  56.     void PerformNormalCommand(Command* cmd);
  57.     void FinishFrom(int n);
  58. public:
  59.     MetaDef(CommandProcessorN);
  60.     CommandProcessorN();
  61. };
  62.  
  63. //---- CommandProcessor10 ------------------------------------------------------
  64.  
  65. class CommandProcessor10 : public CommandProcessor {
  66. protected:
  67.     Command **mem;
  68.     int start, size;
  69.  
  70.     ~CommandProcessor10();
  71.     Command *GetAt(int i);
  72.     void PerformNormalCommand(Command* cmd);
  73.     void FinishFrom(int n);
  74. public:
  75.     MetaDef(CommandProcessor10);
  76.     CommandProcessor10(int s);
  77. };
  78.  
  79. #endif
  80.  
  81.